package com.wpf.test03;

import java.util.Objects;

public class Student {
    private String name;
    private int age;
    private String skill;

    public Student() {
    }

    public Student(String name, int age, String skill) {
        this.name = name;
        this.age = age;
        this.skill = skill;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getSkill() {
        return skill;
    }

    public void setSkill(String skill) {
        this.skill = skill;
    }

    @Override
    public boolean equals(Object o) {
        // s1 == s2     //比较地址是否相同
        if (this == o) return true;

        // s2 == null 或者 s1.class 与s2.class的数据类型不同
        if (o == null || getClass() != o.getClass()) return false;
        Student student = (Student) o;
        return age == student.age && Objects.equals(name, student.name) && Objects.equals(skill, student.skill);
    }


}
